package pl.edu.agh.uddiProxy;

import org.springframework.security.Authentication;
import org.springframework.security.context.SecurityContextHolder;

import pl.edu.agh.uddiProxy.dao.DAOHelper;

public class AuthenticationHelper {
	public static Authentication login(Authentication authentication) {
		Authentication auth = DAOHelper.getAuthenticationManager().doAuthentication(authentication);
		
		SecurityContextHolder.getContext().setAuthentication(auth);
		return auth;
	}
	
	public static void logout(Authentication authentication) {
		SecurityContextHolder.getContext().setAuthentication(authentication);
	}
}
